package com.buer.train.common.utils;

import java.math.BigDecimal;

public class WebInterfaceUtils {
		public static Object paramsAnalysis(String params , boolean encrypt ,Class beanType){
			Object object;
			String jsonData = params;
			try {
				if(encrypt){
					jsonData =  Aes.aesDecrypt(params);
				}
				System.out.println("解密之后："+jsonData);
				object = JsonUtils.jsonToPojo(jsonData, beanType);
				return object;
			} catch (Exception e) {
				e.printStackTrace();
				return null;
			}
		}
		
	 public static void main(String[] args) throws Exception {
		// String token = UUID.randomUUID().toString();
		 
		// String str = "{\"username\":\"18365290156111111\", \"password\":\"666666\"}"; 
		 String str = "{\"token\":\"0c148c72-4447-4d23-a704-d3756e6783dc\"}"; 
		 
		// System.out.println(Des3.encode(str));
		/* Map map=(Map) paramsAnalysis(str,false,Map.class);
		 System.out.println(map);*/

		/* String reqPassWord = MD5Utils.encrypt("jd", "123456");
		 System.out.println(reqPassWord);*/

		 BigDecimal a = new BigDecimal(1);
		 BigDecimal b = new BigDecimal(2);
		 BigDecimal divide = a.divide(b,2,BigDecimal.ROUND_HALF_UP);
		// BigDecimal add = divide.add(a);
		 System.out.println(divide);
	}
	
}
